{% load i18n %}

<div id="addEvent">
    <form class="addTimetable" action="{% url 'donutscheduler.views.addEvent' %}" method="post">
        {% csrf_token %}
        <table class="table">
            <thead>
                <th>
                    <h2>{% trans "Add event" %}</h2>
                    {{ form.ev_color }}
                </th>
            </thead>
            <tbody>
                {% for field in form %}
                    {% if not forloop.last %}
                        {% cycle "<tr><td>" "<td>" %}
                    {% endif %}
                    {% if field.errors %}
                        <div class="alert alert-error">
                            <button type="button" class="close" data-dismiss="alert">&times;</button>
                            {{ field.errors }}
                        </div>
                    {% endif %}
                    {% if not forloop.last %}
                        {% trans field.label_tag %}
                        {{ field }}
                        {% cycle "</td>" "</td></tr>" %}
                    {% endif %}

                {% endfor %}
            </tbody>
        </table>
        <input type="submit" id="button_addEvent" class="btn btn-primary" value="{% trans 'ADD' %}">
    </form>
</div>